//
//  MovieDetail.m
//  doubanMovie
//
//  Created by lanou3g on 15/11/21.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "MovieDetail.h"
#import "UIImage+LoadImage.h"
@interface MovieDetail ()



@end

@implementation MovieDetail

- (void)loadImage
{
    __weak typeof(self) weakSelf = self;
    [UIImage loadImageWithURLStr:self.pic_url withBackBlock:^(UIImage *image) {
        weakSelf.imageList = image;
        self.isLoading = NO;
    }];
    self.isLoading = YES;
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        _poster = [aDecoder decodeObjectForKey:@"poster"];
        _rating = [aDecoder decodeObjectForKey:@"rating"];
        _rating_count = [aDecoder decodeObjectForKey:@"rating_count"];
        _runtime = [aDecoder decodeObjectForKey:@"runtime"];
        _release_date = [aDecoder decodeObjectForKey:@"release_data"];
        _genres = [aDecoder decodeObjectForKey:@"genres"];
        _country = [aDecoder decodeObjectForKey:@"country"];
        _actors = [aDecoder decodeObjectForKey:@"actors"];
        _plot_simple = [aDecoder decodeObjectForKey:@"plost_simple"];
        _movieName = [aDecoder decodeObjectForKey:@"movieName"];
        _pic_url = [aDecoder decodeObjectForKey:@"pic_url"];
        _movieId = [aDecoder decodeObjectForKey:@"movieId"];
    }
    return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:_poster forKey:@"poster"];
    [aCoder encodeObject:_rating forKey:@"rating"];
    [aCoder encodeObject:_rating_count forKey:@"rating_count"];
    [aCoder encodeObject:_runtime forKey:@"runtime"];
    [aCoder encodeObject:_release_date forKey:@"release_data"];
    [aCoder encodeObject:_genres forKey:@"genres"];
    [aCoder encodeObject:_country forKey:@"country"];
    [aCoder encodeObject:_actors forKey:@"actors"];
    [aCoder encodeObject:_plot_simple forKey:@"plost_simple"];
    [aCoder encodeObject:_movieName forKey:@"movieName"];
    [aCoder encodeObject:_pic_url forKey:@"pic_url"];
    [aCoder encodeObject:_movieId forKey:@"movieId"];
   
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{

}


- (NSString *)description
{
    return [NSString stringWithFormat:@"poster = %@ rating = %@ rating_count = %@ runtime = %@ release_data = %@ genres = %@ country = %@ actors = %@ plost_simple = %@ movieName = %@ pic_url = %@ movieID = %@",self.poster,self.rating,self.rating_count,self.runtime,self.release_date,self.genres,self.country,self.actors,self.plot_simple,self.movieName,self.pic_url,self.movieId];
}
@end
